<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Platform Security Architecture — cryptography and keystore interface: Key lifetime</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Platform Security Architecture — cryptography and keystore interface
   &#160;<span id="projectnumber">Working draft</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Key lifetime</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga8b438870ba69489b685730d346455108"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__persistence.html#ga8b438870ba69489b685730d346455108">PSA_KEY_LIFETIME_VOLATILE</a>&#160;&#160;&#160;((<a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a>)0x00000000)</td></tr>
<tr class="separator:ga8b438870ba69489b685730d346455108"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3713a01c5fcd5f7eae46ff22ceaf6d02"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__persistence.html#ga3713a01c5fcd5f7eae46ff22ceaf6d02">PSA_KEY_LIFETIME_PERSISTENT</a>&#160;&#160;&#160;((<a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a>)0x00000001)</td></tr>
<tr class="separator:ga3713a01c5fcd5f7eae46ff22ceaf6d02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae6b8443238ef1900cf132550d7df557f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__persistence.html#gae6b8443238ef1900cf132550d7df557f">PSA_KEY_LIFETIME_WRITE_ONCE</a>&#160;&#160;&#160;((<a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a>)0x7fffffff)</td></tr>
<tr class="separator:gae6b8443238ef1900cf132550d7df557f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga6821ff6dd39dc2bc370ded760ad8b0cf"><td class="memItemLeft" align="right" valign="top">typedef uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a></td></tr>
<tr class="separator:ga6821ff6dd39dc2bc370ded760ad8b0cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaf0daaa1dba14dc324ca83dfe1495a5e2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__persistence.html#gaf0daaa1dba14dc324ca83dfe1495a5e2">psa_get_key_lifetime</a> (<a class="el" href="group__platform.html#gac3da92a6b8a7f0c01dc348f8e0432e4c">psa_key_slot_t</a> key, <a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a> *lifetime)</td></tr>
<tr class="memdesc:gaf0daaa1dba14dc324ca83dfe1495a5e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve the lifetime of a key slot.  <a href="#gaf0daaa1dba14dc324ca83dfe1495a5e2">More...</a><br /></td></tr>
<tr class="separator:gaf0daaa1dba14dc324ca83dfe1495a5e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1bd1ee6d00ebd9962fc6ad72cbd22ef8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__persistence.html#ga1bd1ee6d00ebd9962fc6ad72cbd22ef8">psa_set_key_lifetime</a> (<a class="el" href="group__platform.html#gac3da92a6b8a7f0c01dc348f8e0432e4c">psa_key_slot_t</a> key, <a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a> lifetime)</td></tr>
<tr class="memdesc:ga1bd1ee6d00ebd9962fc6ad72cbd22ef8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the lifetime of a key slot.  <a href="#ga1bd1ee6d00ebd9962fc6ad72cbd22ef8">More...</a><br /></td></tr>
<tr class="separator:ga1bd1ee6d00ebd9962fc6ad72cbd22ef8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga3713a01c5fcd5f7eae46ff22ceaf6d02"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3713a01c5fcd5f7eae46ff22ceaf6d02">&#9670;&nbsp;</a></span>PSA_KEY_LIFETIME_PERSISTENT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_KEY_LIFETIME_PERSISTENT&#160;&#160;&#160;((<a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a>)0x00000001)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A persistent key slot retains its content as long as it is not explicitly destroyed. </p>

</div>
</div>
<a id="ga8b438870ba69489b685730d346455108"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8b438870ba69489b685730d346455108">&#9670;&nbsp;</a></span>PSA_KEY_LIFETIME_VOLATILE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_KEY_LIFETIME_VOLATILE&#160;&#160;&#160;((<a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a>)0x00000000)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A volatile key slot retains its content as long as the application is running. It is guaranteed to be erased on a power reset. </p>

</div>
</div>
<a id="gae6b8443238ef1900cf132550d7df557f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae6b8443238ef1900cf132550d7df557f">&#9670;&nbsp;</a></span>PSA_KEY_LIFETIME_WRITE_ONCE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_KEY_LIFETIME_WRITE_ONCE&#160;&#160;&#160;((<a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a>)0x7fffffff)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A write-once key slot may not be modified once a key has been set. It will retain its content as long as the device remains operational. </p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga6821ff6dd39dc2bc370ded760ad8b0cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6821ff6dd39dc2bc370ded760ad8b0cf">&#9670;&nbsp;</a></span>psa_key_lifetime_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef uint32_t <a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encoding of key lifetimes. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaf0daaa1dba14dc324ca83dfe1495a5e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf0daaa1dba14dc324ca83dfe1495a5e2">&#9670;&nbsp;</a></span>psa_get_key_lifetime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a> psa_get_key_lifetime </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__platform.html#gac3da92a6b8a7f0c01dc348f8e0432e4c">psa_key_slot_t</a>&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a> *&#160;</td>
          <td class="paramname"><em>lifetime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve the lifetime of a key slot. </p>
<p>The assignment of lifetimes to slots is implementation-dependent.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">key</td><td>Slot to query. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">lifetime</td><td>On success, the lifetime value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga4cc859e2c66ca381c7418db3527a65e1">PSA_SUCCESS</a></td><td>Success. </td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga798df25a505ebf931f7bec1f80f1f85f">PSA_ERROR_INVALID_ARGUMENT</a></td><td>The key slot is invalid. </td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga5cdb6948371d49e916106249020ea3f7">PSA_ERROR_COMMUNICATION_FAILURE</a></td><td></td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga08b10e70fa5ff0b05c631d9f8f6b2c6b">PSA_ERROR_HARDWARE_FAILURE</a></td><td></td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga2c5dda1485cb54f2385cb9c1279a7004">PSA_ERROR_TAMPERING_DETECTED</a></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga1bd1ee6d00ebd9962fc6ad72cbd22ef8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1bd1ee6d00ebd9962fc6ad72cbd22ef8">&#9670;&nbsp;</a></span>psa_set_key_lifetime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a> psa_set_key_lifetime </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__platform.html#gac3da92a6b8a7f0c01dc348f8e0432e4c">psa_key_slot_t</a>&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__persistence.html#ga6821ff6dd39dc2bc370ded760ad8b0cf">psa_key_lifetime_t</a>&#160;</td>
          <td class="paramname"><em>lifetime</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Change the lifetime of a key slot. </p>
<p>Whether the lifetime of a key slot can be changed at all, and if so whether the lifetime of an occupied key slot can be changed, is implementation-dependent.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Slot whose lifetime is to be changed. </td></tr>
    <tr><td class="paramname">lifetime</td><td>The lifetime value to set for the given key slot.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga4cc859e2c66ca381c7418db3527a65e1">PSA_SUCCESS</a></td><td>Success. </td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga798df25a505ebf931f7bec1f80f1f85f">PSA_ERROR_INVALID_ARGUMENT</a></td><td>The key slot is invalid, or the lifetime value is invalid. </td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga1dcc6d130633ed5db8942257581b55dd">PSA_ERROR_NOT_SUPPORTED</a></td><td>The implementation does not support the specified lifetime value, at least for the specified key slot. </td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#gac2fee3a51249fbea45360aaa911f3e58">PSA_ERROR_OCCUPIED_SLOT</a></td><td>The slot contains a key, and the implementation does not support changing the lifetime of an occupied slot. </td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga5cdb6948371d49e916106249020ea3f7">PSA_ERROR_COMMUNICATION_FAILURE</a></td><td></td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga08b10e70fa5ff0b05c631d9f8f6b2c6b">PSA_ERROR_HARDWARE_FAILURE</a></td><td></td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga2c5dda1485cb54f2385cb9c1279a7004">PSA_ERROR_TAMPERING_DETECTED</a></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
